# @file    : threads_test
# @time    : 2025/3/25
# @author  : yongpeng.yao
# @desc    :
import json

from dashscope import Threads
from dotenv import load_dotenv

load_dotenv()
# save_api_key(os.getenv("DASHSCOPE_API_KEY"))  # 保存 API 密钥
thread = Threads.create(messages=[{"role": "user",
                                   "content": "我把每束花定价为进价的基础上加价20%，当进价为80元时，我的售价是多少。"}])
print(json.dumps(thread, default=lambda o: o.__dict__, sort_keys=True, indent=4))

result = {
    "created_at": 1742889872434,
    "id": "thread_71d5bb80-09f5-4a6c-a4f8-6a77d1074276",
    "metadata": {},
    "object": "thread",
    "request_id": "7f6a2ef9-ac10-9a34-80f6-d8eb2defe467",
    "status_code": 200
}
